package io.github.tangwan.utils;

import cn.hutool.extra.pinyin.PinyinUtil;
import com.github.promeg.pinyinhelper.Pinyin;
import com.github.promeg.tinypinyin.lexicons.java.cncity.CnCityDict;

/**
 * @author tangwan
 * @version V1.0
 * created on 2021/9/22 14:16
 * @since JDK 1.8
 */
public class PingYinUtil {

    public static void main(String[] args) {
        String pinyin = PinyinUtil.getPinyin("你好","");
        System.out.println(pinyin);
        System.out.println(PinyinUtil.getFirstLetter("北京",""));
        Pinyin.init(Pinyin.newConfig().with(CnCityDict.getInstance()));
        System.out.println(PinyinUtil.getFirstLetter("重庆",""));
    }

}
